﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.Configuration;
using Microsoft.Win32;
using System.Collections.Specialized;
using SemiCASE.DataType.Common.Cryptography;


namespace SemiCASE.DataAccess
{
    public class ConnectionStringHelper
    {
       
        private static Dictionary<string, string> connectionStringCache = new Dictionary<string, string>();

        public static string GetConnectionString(string sDBConstrName)
        {
            
            string connStr = string.Empty;

            if (!connectionStringCache.TryGetValue(sDBConstrName, out connStr))
            {
                connStr = ConfigurationManager.ConnectionStrings[sDBConstrName].ConnectionString;
                connectionStringCache.Add(sDBConstrName,connStr );
                
            }
            return connStr;
            
        }


        private static string Decrypt(string cipherText)
        {

            return Crytography.Decrypt(cipherText);
        }

    }

}
